package com.example.demo006miniojavaboy.controller;

import com.example.demo006miniojavaboy.minio.MinioRespCode;
import com.example.demo006miniojavaboy.minio.MinioUtil;
import com.example.demo006miniojavaboy.minio.UploadResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
public class HelloController {

    @Autowired
    MinioUtil minioUtil;
    @PostMapping("/upload")
    public UploadResponse upload(MultipartFile file) throws Exception {
        return minioUtil.uploadFile(file, "bucket01");
    }

}
